package com.xhblog.controller;

import com.xhblog.entity.dto.LoginDto;
import com.xhblog.result.Result;
import com.xhblog.service.LoginService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author pengyouhong
 * create 2022/5/18 18:20
 */


@RestController
@RequestMapping("login")
public class LoginController {

    @Resource
    private LoginService loginService;

    @PostMapping
    public Result login(@RequestBody LoginDto loginDto) {
        return loginService.login(loginDto);
    }
}
